<?php
/**
 * Created by PhpStorm.
 * User: zkc
 * Date: 2018-10-12
 * Time: 09:45
 */

namespace common\utils\soap;


class SoapClientBuilder
{

    /**
     * 构建SoapClient
     *
     * @param string     $name    对方系统名称
     * @param string     $url     Soap wsdl    参考原生 \SoapClient ($wsdl, array $options = null)
     * @param array|null $options Soap options 参考原生 \SoapClient ($wsdl, array $options = null)
     *
     * @return SoapClient
     */
    public static function build($name, $url, array $options = null)
    {
        $client = new SoapClient([
            'name'    => $name,
            'url'     => $url,
            'options' => $options,
        ]);

        return $client;
    }

}